<?php

/**
 * Url builer
 *
 * @param string $url
 * @param array $params
 * @return string
 */
function uri_builder($url, array $params)
{
	return $url . '?' . http_build_query($params);
}

/**
 * Open an external resource
 *
 * @param string $url
 * @return string
 */
function fopenCurl($url)
{
	$result = NULL;

	$ch = curl_init();
	$options = array
                    (
                    CURLOPT_URL			=> $url,
                    CURLOPT_HEADER              => FALSE,
                    CURLOPT_RETURNTRANSFER	=> TRUE,
                    CURLOPT_FAILONERROR		=> TRUE
                    ); curl_setopt_array($ch, $options);

	$data = curl_exec($ch);
	if ($data !== FALSE)
	{
		$result = $data;
	}
	curl_close($ch);

	return $result;
}

# EOF
